package com.ruoyi.business.domain.enums;

public enum ReviewStatusEnum {
    PENDING(1, "待审核"),
    APPROVED(2, "已通过"),
    REJECTED(3, "未通过");

    private final int key;
    private final String label;

    ReviewStatusEnum(int key, String label) {
        this.key = key;
        this.label = label;
    }

    public int getKey() {
        return key;
    }

    public String getLabel() {
        return label;
    }

    // 根据键值获取枚举实例
    public static ReviewStatusEnum fromKey(int key) {
        for (ReviewStatusEnum status : ReviewStatusEnum.values()) {
            if (status.getKey() == key) {
                return status;
            }
        }
        throw new IllegalArgumentException("No enum constant for [" + key + "]");
    }
}